/**
 * 文件名：Role.java
 * 创建时间：Jul 6, 20091:25:03 PM
 */
package com.lane.sidecn.security.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * 系统用户角色实体类
 * 
 * @author 忽吉烈
 * 
 */
@Entity
@Table(name = "ROLE")
public class Role {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer role_id;

	@Column(name = "rolename", length = 50, nullable = false)
	private String roleName;

	@ManyToMany(mappedBy = "roles")
	private Set<SysUser> users = new HashSet<SysUser>();

	@ManyToMany(mappedBy = "roles")
	private Set<Resource> resources = new HashSet<Resource>();

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public Integer getRole_id() {
		return role_id;
	}

	public void setRole_id(Integer role_id) {
		this.role_id = role_id;
	}

	public Set<SysUser> getUsers() {
		return users;
	}

	public void setUsers(Set<SysUser> users) {
		this.users = users;
	}

	public Set<Resource> getResources() {
		return resources;
	}

	public void setResources(Set<Resource> resources) {
		this.resources = resources;
	}

}
